package com.cq.androidtools.jetpack.paging3

import androidx.paging.Pager
import androidx.paging.PagingConfig
import androidx.paging.PagingData
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

/**
 * 作者: CQ
 * 日期: 2021-07-07
 * 说明:
 */
class Repository @Inject constructor() {
    companion object {
        private const val PAGE_SIZE = 10
    }

    fun getPagingData() : Flow<PagingData<Repo>> {
        return Pager(config = PagingConfig(PAGE_SIZE), pagingSourceFactory = {RepoPagingSource()}).flow
    }
}